package day124;

public class RegDemo11 {
    public static void main(String[] args) {


        String reg = "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}";
        String reg1 = "(\\d{1,3}\\.){3}\\d{1,3}";

        String s1 = "172.156.1.20";
        String s2 = "10-5-5-6";
        String s3 = "18.8.8.8";

        System.out.println(s1.matches(reg1));
        System.out.println(s2.matches(reg1));
        System.out.println(s3.matches(reg));
    }
}